package com.linsen.erp.admin.provider.enums;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.HashMap;
import java.util.Map;


//最高学历
@Getter
@AllArgsConstructor
public enum HighestAcademicQualificationsEnum {
    PRIMARY_SCHOOL(1,"小学"),
    MIDDLE_SCHOOL(2,"初中"),
    HIGH_SCHOOL(3,"高中"),
    JUNIOR_COLLEGES(4,"大专"),
    UNDERGRADUATE(5,"本科"),
    POSTGRADUATE(6,"硕士"),
    PHD(7,"博士"),
    ;

    @JsonValue
    private final Integer value;
    private final String desc;

    private static final Map<Integer, HighestAcademicQualificationsEnum> VALUES = new HashMap<>();

    static {
        for (final HighestAcademicQualificationsEnum highestAcademicQualificationsEnum : HighestAcademicQualificationsEnum.values()) {
            HighestAcademicQualificationsEnum.VALUES.put(highestAcademicQualificationsEnum.getValue(), highestAcademicQualificationsEnum);
        }
    }

    @JsonCreator
    public static HighestAcademicQualificationsEnum getByValue(Integer value) {
        return HighestAcademicQualificationsEnum.VALUES.get(value);
    }
}